$def with(mce='false', thumb = 1)
$:render.admin.header(css=['admin/css/popup.css','admin/css/media.css'],scripts=['scripts/libs/plupload/plupload.js','scripts/libs/plupload/plupload.browserplus.js','scripts/libs/plupload/plupload.flash.js','scripts/libs/plupload/plupload.html5.js','scripts/libs/plupload/plupload.html4.js','scripts/libs/plupload/plupload.gears.js','scripts/libs/plupload/plupload.silverlight.js','admin/scripts/media-upload.js'])

<script type="text/javascript">
    var uploaderInit = {
        'runtimes': 'html5,silverlight,flash,html4',
        'browse_button': 'plupload-browse-button',
        'container': 'plupload-upload-ui',
        'drop_element': 'drag-drop-area',
        'file_data_name': 'async_upload',
        'multiple-queues': 'true',
        'max_file_size': '2097152b',
        'url': '/admin/media/async-upload',
        'flash_swf_url': '/static/scripts/libs/plupload/plupload.flash.swf',
        'silverlight_xap_url': '/static/scripts/libs/plupload/plupload.silverlight.xap',
        'filters': [{'title': 'Image files', 'extensions': 'jpg,gif,png'}],
        'multipart': true,
        'urlstream_upload': true,
        'multipart_params': {}
    };
    var post_id = 0;
</script>

<div id="media-upload-header">
	<ul id="sidemenu">
		<li id="tab-type"><a href="$config.ADMIN_DIR/media/upload" class="current">从计算机</a></li>
        <!--<li id="tab-type_url"><a href="javascript:;">从 URL</a></li>-->
		<li id="tab-library"><a href="$config.ADMIN_DIR/media/library?mce=$mce&thumb=$thumb">媒体库</a></li>
	</ul>
</div>

<form enctype="multipart/form-data" method="post" id="image-form" class="media-upload-form type-form">
    <h3 class="media-title">从您的计算机添加媒体文件</h3>
    <div id="media-upload-notice"></div>
    <div id="media-upload-error"></div>
    <div id="plupload-upload-ui" class="hide-if-no-js">
        <div id="drag-drop-area">
            <div class="drag-drop-inside">
                <p class="drag-drop-info">将文件拖到这里</p>
                <p>或</p>
                <p class="drag-drop-buttons"><input type="button" id="plupload-browse-button" value="选择文件" class="btn" /></p>
            </div>
        </div>
	    <p class="upload-flash-bypass">
        您正在使用高级多文件上传工具。不能正确上传？请尝试使用<a href="#">标准的浏览器上传工具</a> 。
        </p>
	</div>
    <span class="max-upload-size">上传文件大小限制：2MB。</span>
	<span class="after-file-upload">文件上传之后，您可以为它添加标题和描述。</span>
    <div id="media-items"></div>
    <p class="savebutton ml-submit" style="display: none; ">
    <input type="submit" name="save" id="save" class="btn" value="保存所有更改"></p>
</form>

$:render.admin.footer()
